# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=gnome-icon-theme
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=3.12.0
pkgrel=1
pkgdesc="GNOME icon theme (mingw-w64)"
arch=('any')
url="https://www.gnome.org"
license=("GPL")
makedepends=("intltool")
depends=("${MINGW_PACKAGE_PREFIX}-hicolor-icon-theme"
         "${MINGW_PACKAGE_PREFIX}-icon-naming-utils"
         "${MINGW_PACKAGE_PREFIX}-gtk2"
         "${MINGW_PACKAGE_PREFIX}-gnome-icon-theme-symbolic")
groups=("${MINGW_PACKAGE_PREFIX}-gnome")
options=(!libtool strip staticlibs)
install=theme-${CARCH}.install
source=(https://download.gnome.org/sources/${_realname}/${pkgver%.*}/${_realname}-$pkgver.tar.xz
        0001-localedir-fix.patch)
sha256sums=('359e720b9202d3aba8d477752c4cd11eced368182281d51ffd64c8572b4e503a'
            'bf568bb64316cc225ea32e27193639c678973b5f2e66f697e794699af08c62f1')

prepare() {
  cd ${srcdir}/${_realname}-${pkgver}
  patch -p1 -i ${srcdir}/0001-localedir-fix.patch
  autoreconf -fiv
}

build() {
  cd ${srcdir}/${_realname}-${pkgver}
  ./configure \
    --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --datarootdir=${MINGW_PREFIX}/share

  make
}

package() {
  cd "${srcdir}/${_realname}-${pkgver}"
  make DESTDIR="$pkgdir" install
  rm -f  "${pkgdir}${MINGW_PREFIX}/share/icons/gnome/icon-theme.cache"
}
